<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″/>
    <title>Pixiv登录页官方推荐</title>
    <script src="https://cdn.bootcss.com/axios/0.18.0/axios.js"></script>
    <script src="https://cdn.bootcss.com/vue/2.5.13/vue.min.js"></script>
    <style>
      body {
        background-color: #78CEEB;
      }
      .box {
        margin: 10px 5px;
        padding: 5px;
        text-align: center;
        background-color: white;
        box-shadow: 3px 3px 2px #888888;
        border-radius: 5px 0 5px 0;
      }
      .info {
        padding: 5px;
      }
      .title {
        font-size: 22px;
        color: black;
      }
      .author {
        font-size: 15px;
        color: grey;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <div class="box">
        <h1>Pixiv登录页官方推荐</h1>
        <h3>最后更新时间: {{ last_update }}</h3>
      </div>
      <hr/>
      <div class="illusts">
        <div class="box" v-for="illust in illusts">
          <a v-bind:href="illust.url">
            <img v-bind:src="illust.img_url" width="100%"/>
          </a>
          <div class="info">
            <a v-bind:href="illust.url" class="title">{{ illust.illust_title }}</a><br/>
            <a v-bind:href="illust.author_url" class="author">{{ illust.author_name }}</a>
          </div>
        </div>
      </div>
    </div>
    <script>
      vm = new Vue({
        el: "#app",
        data: {
          last_update: "未知",
          illusts: []
        },
        mounted: function(){
          axios.get("data.json").then(function(r){
            // alert(r.data.copyright);
            vm.illusts = r.data.illusts;
            vm.last_update = r.data.last_update;
          });
        }
      });
    </script>
  </body>
</html>